﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SourFruit.level.obj;
using Microsoft.Xna.Framework.Graphics;

namespace SourFruit.level
{
    public class SpaceLevel : LevelFactory
    {
        public enum SpacePlatforms { small_asteroid = 0, big_asteroid, tiny_sun }
        public enum CaveCollectable { }

        public Platform CreatePlatform(int type, int posX, int posY, Texture2D text, MovingOptions moves)
        {
            if (type > 2) return null;
            SpacePlatforms plattype = (SpacePlatforms)type;
            Platform platform;
            switch (plattype)
            { 
                case SpacePlatforms.small_asteroid:
                    platform = new Platform(posX, posY, text.Width, text.Height, text, true, moves, 1f);  
                    break;
                case SpacePlatforms.big_asteroid:
                    platform = new Platform(posX, posY, text.Width, text.Height, text, true);  
                    break;
                default: //tiny_sun
                    platform = new Platform(posX, posY, text.Width, text.Height, text, false);  
                    break;
            }
            return platform;
        }

        public Collectable CreateCollectable(int type, int posX, int posY, Texture2D text)
        {
            return new Collectable(posX, posY, text.Width, text.Height, text, 1);
        }


        public Platform CreatePlatform(int type, int posX, int posY, Texture2D[] textStrip, MovingOptions moves)
        {
            if (type > 2) return null;
            SpacePlatforms plattype = (SpacePlatforms)type;
            Platform platform;
            switch (plattype)
            {
                case SpacePlatforms.small_asteroid:
                    platform = new Platform(posX, posY, textStrip[0].Width, textStrip[0].Height, textStrip, 100, true);
                    break;
                case SpacePlatforms.big_asteroid:
                    platform = new Platform(posX, posY, textStrip[0].Width, textStrip[0].Height, textStrip, 100, true);
                    break;
                default: //tiny_sun
                    platform = new Platform(posX, posY, textStrip[0].Width * 2, textStrip[0].Height * 2, textStrip, 100, false);
                    break;
            }
            return platform;
        }
    }
}
